package com.three.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.three.entity.Staff;
import com.three.mapper.StaffMapper;
import com.three.service.QuitStaffService;
import com.three.vo.R;
import com.three.vo.StaffInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpSession;
import java.util.List;

@Service
public class QuitStaffServiceImpl implements QuitStaffService {
    @Autowired
    private StaffMapper staffMapper;
    @Autowired
    private HttpSession session;

    //查询所有离职员工
    @Override
    public R getQuitStaff(Integer currentPage, Integer pageSize,StaffInfoVo staffInfoVo) {
        //开启分页
        PageHelper.startPage(currentPage,pageSize);
        List<Staff> staffList = staffMapper.selectByState(staffInfoVo);

        PageInfo<Staff> pageInfo = new PageInfo<>(staffList);
        return R.ok(pageInfo);
    }
}
